package com.my.study.structures.search;

/**
 * @author Carlos
 * @version 1.0
 * @Description 线性查找
 *
 * 基本思想：逐一比对
 *
 * @date 2021/7/27 22:26
 **/
public class SeqSearch {

    public static void main(String[] args) {
        int[] arr = {1, 2, 99, 23, 2432, 887, 23,2983};


    }


    private static int search(int[] arr, int value) {

        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == value) {
                return i;
            }
        }

        return -1;
    }

}
